import moment from 'moment'
import 'moment/locale/zh-cn'
moment.locale('zh-cn')

export default {
  name: 'datefmt',
  filter: function (input, pattern = 'YYYY-MM-DD') {
    if (!input) return ''
    return moment(input).format(pattern)
  }
}
